|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.starmicronics.stario.StarIOPort
public class StarIOPort
This class provides a communications API for Star's printers. It supports serial, parallel, usb, and ethernet based printers, and hides most of the low level behavioral differences inherent in those different communication forms.
| Method Summary | |
|---|---|
StarPrinterStatus |
beginCheckedBlock()
This method initiates a checked block printing operation and returns the device's detailed status. |
StarPrinterStatus |
endCheckedBlock()
This method ends a checked block printing operation and returns the device's detailed status. |
protected void |
finalize()
|
static StarIOPort |
getPort(java.lang.String portName,
java.lang.String portSettings,
int ioTimeoutMillis)
This method opens a connection to the specified port. |
java.lang.String |
getPortName()
This method returns the port name as it was originally specified. |
java.lang.String |
getPortSettings()
This method returns the port settings as they were originally specified. |
int |
readPort(byte[] readBuffer,
int offset,
int size)
This method reads data from the device. |
static void |
releasePort(StarIOPort port)
This function closes a connection to the port specified. |
void |
resetDevice()
This method resets the device at the hardware level. |
StarPrinterStatus |
retreiveStatus()
This method retreives the device's detailed status. |
int |
writePort(byte[] writeBuffer,
int offset,
int size)
This method writes data to the device. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static StarIOPort getPort(java.lang.String portName,
java.lang.String portSettings,
int ioTimeoutMillis)
throws StarIOPortException
portName - is the name of the port to openportSettings - gives the port settings - "9600,n,8,1,h" for serial, "" for all othersioTimeoutMillis - millisecond timeout controlling internally used communication APIs (this parameter garantees that all of the below APIs will complete in a bounded amount of time, but does NOT garantee the exact timeout length)
StarIOPortException - when a communication failure occurs.public static void releasePort(StarIOPort port)
port - StarIOPort type representing previously created portpublic java.lang.String getPortName()
public java.lang.String getPortSettings()
public int writePort(byte[] writeBuffer,
int offset,
int size)
throws StarIOPortException
writeBuffer - contains the output dataoffset - specifies where to begin pulling data from writeBuffer - zero-based offsetsize - number of bytes to write
StarIOPortException - when a communication failure occurs
public int readPort(byte[] readBuffer,
int offset,
int size)
throws StarIOPortException
readbuffer - buffer into which data is readoffset - specifies where to begin writing data into the readBuffer - zero-based offsetsize - number of bytes to read
StarIOPortException - when a communication failure occurs
public StarPrinterStatus retreiveStatus()
throws StarIOPortException
StarIOPortException - when a communication failure occurs
public StarPrinterStatus beginCheckedBlock()
throws StarIOPortException
StarIOPortException - when a communication failure occurs
public StarPrinterStatus endCheckedBlock()
throws StarIOPortException
StarIOPortException - when a communication failure occurs
public void resetDevice()
throws StarIOPortException
StarIOPortException - when a communication failure occurs
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||